<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<script type="text/javascript">
    $(function () {
        $('.land-table').dataTable({
            "sPaginationType": "full_numbers",
            "bDestroy": true,
            "oLanguage": {
                "sZeroRecords": $('#no-record').val(),
                "sLengthMenu": $('#display').val() + " _MENU_ " + $('#records').val(),
                "sSearch": $('#search').val(),
                "sInfo": $('#showing').val() + " _START_ " + $('#to').val() + " _END_ " + $('#of').val() + " _TOTAL_ " + $('#entries').val(),
                "sInfoEmpty": $('#no-record').val(),
                "oPaginate": {
                    "sFirst": $('#first').val(),
                    "sLast": $('#last').val(),
                    "sNext": $('#next').val(),
                    "sPrevious": $('#previous').val()
                }
            },
            "fnDrawCallback": function () {
                if ($('.dataTables_paginate span span.paginate_button').size()) {
                    $('.dataTables_paginate')[0].style.display = "block";
                } else {
                    $('.dataTables_paginate')[0].style.display = "none";
                }
            }
        });
    });

</script>

<div id="land-registration-module-home-title" class="module-home-title">
    <s:a href="home.do">
        <span><img src="${pageContext.request.contextPath}/images/land-reg.png" alt="Land Registration">
            <s:label value="%{getText('generateInitAppAcknowledgement.label')}"/></span>
    </s:a>
    <div id="back-button" align="right">
        <s:form><s:submit value="%{getText('back_btn.label')}" action="home"/></s:form>
    </div>
</div>
<%--<s:include value="../notifications.jsp"/>--%>
<h2><s:label value="%{getText('generateInitAppAcknowledgement.label')}"/></h2>
<table class="width-100 margin-10-auto table land-table">
    <thead>
    <tr class="center-align table-header">
        <%--  <th><s:label value="%{getText('refNo.label')}"/></th>  --%>
        <th><s:label value="%{getText('applied_date.label')}"/></th>
        <th><s:label value="%{getText('applicant_name.label')}"/></th>
        <th><s:label value="%{getText('applicant_name.label')}"/></th>
        <th><s:label value="%{getText('action.label')}"/></th>
    </tr>
    </thead>
    <tbody>
    <s:iterator status="status" value="landApplicationList">
        <tr class="<s:if test="#status.odd == true">table-row-odd</s:if><s:else>table-row-even</s:else>">
                <%-- <td class="center-align"><s:property value="refNumber"/></td>  --%>
            <td class="center-align"><s:property value="submitDate"/></td>
            <td class="center-align"><s:property value="holder.name"/></td>
            <s:if test="workflowItem != null">
                <td class="center-align"><s:label name="workflowItem.workflowTask.action"/></td>
            </s:if>
            <s:else>
                <td class="center-align"><s:property value="initialStatus"/></td>
            </s:else>
            <td class="center-align">
                <s:url id="initialLetter" action="generateInitialApplicationAcknowledgement">
                    <s:param name="applicationId" value="id"/>
                </s:url>
                <s:a href="%{initialLetter}" title="%{getText('initialApplicationAcknowledgement_tooltip')}">
                    <img src="<s:url value='/images/print.png'/>" border="none" width="25"
                         height="25"/>
                </s:a>

                <s:url id="registerLetter" action="loadLetterRegistrationPage">
                    <s:param name="moduleId" value="id"/>
                </s:url>
                <s:a href="%{registerLetter}" title="%{getText('registerLetter_tooltip')}">
                    <img src="<s:url value='/images/register-letter.jpg'/>" border="none"/>
                </s:a>

                    <%-- <s:url id="resubmit" action="resubmitInitialAppPageLoad">
                        <s:param name="applicationId" value="id"/>
                    </s:url>
                    <s:a href="%{resubmit}" title="%{getText('resubmitPageLoad_tooltip')}">
                        <img src="<s:url value='/images/approve.png'/>" border="none" width="25"
                             height="25"/>
                    </s:a>--%>
            </td>
        </tr>
    </s:iterator>
    </tbody>
</table>
<%--
<s:hidden id="appliedDate" value="%{getText('applied_date.label')}"/>
<s:hidden id="applicantName" value="%{getText('applicant_name.label')}"/>--%>

<%-- Localization text for data tables --%>
<s:hidden id="display" value="%{getText('display.label')}"/>
<s:hidden id="records" value="%{getText('records.label')}"/>
<s:hidden id="search" value="%{getText('search.label')}"/>
<s:hidden id="no-record" value="%{getText('no_record.label')}"/>
<s:hidden id="showing" value="%{getText('showing.label')}"/>
<s:hidden id="to" value="%{getText('to.label')}"/>
<s:hidden id="of" value="%{getText('of.label')}"/>
<s:hidden id="entries" value="%{getText('entries.label')}"/>
<s:hidden id="first" value="%{getText('first.label')}"/>
<s:hidden id="last" value="%{getText('last.label')}"/>
<s:hidden id="next" value="%{getText('next.label')}"/>
<s:hidden id="previous" value="%{getText('previous.label')}"/>